.TH std::experimental::simd::operator++,std::experimental::simd::operator-- 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::experimental::simd::operator++,std::experimental::simd::operator-- \- std::experimental::simd::operator++,std::experimental::simd::operator--

.SH Synopsis
   simd& operator++() noexcept;     \fB(1)\fP (parallelism TS v2)
   simd operator++( int ) noexcept; \fB(2)\fP (parallelism TS v2)
   simd& operator--() noexcept;     \fB(3)\fP (parallelism TS v2)
   simd operator--( int ) noexcept; \fB(4)\fP (parallelism TS v2)

   Applies the increment or decrement operator on each element of the simd.

   1) Increments all values in the simd by 1 and returns a reference to itself.
   2) Increments all values in the simd by 1 and returns a copy of itself before the
   operation.
   3) Decrements all values in the simd by 1 and returns a reference to itself.
   4) Decrements all values in the simd by 1 and returns a copy of itself before the
   operation.

.SH Example


// Run this code

 #include <cstddef>
 #include <experimental/simd>
 #include <iostream>
 namespace stdx = std::experimental;

 void print(auto rem, auto const& a)
 {
     std::cout << rem << ": ";
     for (std::size_t i{}; i != std::size(a); ++i)
         std::cout << a[i] << ' ';
     std::cout << '\\n';
 }

 int main()
 {
     stdx::native_simd<int> p = -2;
     print('p', p);

     ++p;
     print('p', p);

     auto q = p--;
     print('p', p);
     print('q', q);
 }

.SH Possible output:

 p: -2 -2 -2 -2
 p: -1 -1 -1 -1
 p: -2 -2 -2 -2
 q: -1 -1 -1 -1
